#!/usr/bin/node

const log = console.log;
argv=process.argv[2];
if(typeof(argv)==='undefined'||argv==='--help'||argv ==='-h'){
  help();
}else{
  calc();
}
function help(){
  const msg = '在文件名后输入参数，对参数表达式进行求值';
  log(msg);
}
function calc(){
  try{
    log(`${argv}=${eval(argv)}`);
  }catch(e){
    log(`${argv}是非法表达式`);      
  }
}
